<?php
namespace Home\Controller;
use Think\Controller;

class ActivityController extends PublicController {
    public function activitylist(){
        $activity=M('activity');
        $activity=$activity->select();
        $this->assign("activity",$activity);
        $this->display();
    }

     //删除活动：王子恒
    public function delete(){
        $id=$_GET['activityid'];
        $activity=M('activity');
        $activity=$activity->where("activityid=$id")->delete();
        if($activity=1){
            $this -> success('删除成功！','');
        }else{
            $this->error('删除失败！','');
        }
    }

    public function editactivity(){
        $id=$_GET['activityid'];
        $activity=M('activity');
        $activity =$activity->where("activityid=$id")->find();
        $this->assign('activity',$activity);
        $this->display();
    }

}